About

Disclaimer

The purpose of the Open Case Studies project is to demonstrate the use of various data science methods, tools, and software in the context of messy, real-world data. A given case study does not cover all aspects of the research process, is not claiming to be the most appropriate way to analyze a given data set, and should not be used in the context of making policy decisions without external consultation from scientific experts.

How do I use this dashboard?

This dashboard…

Does Open Case Studies have more resources I can access to learn about creating this dashboard?

We created…

RA Notes

This works but the logo is too large.

---
title: "School Shootings"
output: 
  flexdashboard::flex_dashboard:
    logo: https://opencasestudies.github.io/img/logo.jpg
    theme: bootstrap
---

This stackoverflow post will tell you exactly how to produce the css code file to fix this problem.

Tutorial

Load the flexdashboard package.

Install the package if you don’t have the package installed already

Once installed, the package is ready to be loaded into the R environment.

This all needs to be done separately in the R console.

Create an RMD document

I was thinking of creating a GIF to show this process as we did with the previous case study. This would highlight the fact that dashboards are mainly a way to display content and, as such, are capable of displaying various types of content.


Dashboards created with flexdashboard

Explain the GIF in the content section

Create an appropriate YAML.

---
title: "Your title"
output: 
  html_document:
    includes:
      after_body: footer.html
---

We used the following YAML for this dashboard.

---
title: "School Shootings"
output: 
  flexdashboard::flex_dashboard:
    theme: bootstrap
---

Step 4

Design the layout of the dashboard.

Dashboards are inherently visual, making this step the most time intensive after content creation. We need to present the data in a way that is both meaning and visually appealing.

For this dashboard, we would like to display the locations of school shootings and provide some information about school shootings.

We are also interested in providing some context to imporant visualizations.

Step 5

Add content to the dashboard.

This would be a great opportunity to reflect on all of the details we have shown up until this point of the tutorial. For example, discuss how this dashboard—created using flexdashboard—displayed a gif, used the storyboards feature, and in contained on a separate page. If done, this can highlight how creative of a process this really is

The Data

Interactive Map

Column

Birthplace of R

Column

Chart 2

Chart 3

Chart 4

Quick Stats

Chart 1

Chart 2

---
title: "School Shooting Dashboard"
output: 
  flexdashboard::flex_dashboard:
    theme: readable
    orientation: columns
    source: embed
---

About {data-icon="fa-question-circle"}
===================================== 

**Disclaimer**

The purpose of the [Open Case Studies](https://opencasestudies.github.io){target="_blank"} project is **to demonstrate the use of various data science methods, tools, and software in the context of messy, real-world data**. A given case study does not cover all aspects of the research process, is not claiming to be the most appropriate way to analyze a given data set, and should not be used in the context of making policy decisions without external consultation from scientific experts. 

**How do I use this dashboard?**

This dashboard...

**Does [Open Case Studies](https://opencasestudies.github.io){target="_blank"} have more resources I can access to learn about creating this dashboard?**

We created...

**RA Notes**

This works but the logo is too large. 

```
---
title: "School Shootings"
output: 
  flexdashboard::flex_dashboard:
    logo: https://opencasestudies.github.io/img/logo.jpg
    theme: bootstrap
---
```

[This stackoverflow post](https://stackoverflow.com/questions/50707189/how-to-add-logo-in-flexdashboard) will tell you exactly how to produce the `css` code file to fix this problem. 

Tutorial {.storyboard data-icon="fa-list-ol"}
=========================================   

### Load the `flexdashboard` package.

Install the package if you don't have the package installed already

```{r, echo=TRUE, eval=FALSE}
install.packages("flexdashboard")
```

Once installed, the package is ready to be loaded into the `R` environment.

```{r, echo=TRUE}
library(flexdashboard)
```

This all needs to be done separately in the `R` console.

### Create an `RMD` document   
    
I was thinking of creating a GIF to show this process as we did with the previous case study. This would highlight the fact that dashboards are mainly a way to display content and, as such, are capable of displaying various types of content.
    
*** 

Dashboards created with `flexdashboard`...

*Explain the GIF in the content section*
    
### Create an appropriate `YAML`.

```
---
title: "Your title"
output: 
  html_document:
    includes:
      after_body: footer.html
---
```

We used the following `YAML` for this dashboard.

```
---
title: "School Shootings"
output: 
  flexdashboard::flex_dashboard:
    theme: bootstrap
---
```

### Step 4

Design the layout of the dashboard.

Dashboards are inherently visual, making this step the most time intensive after content creation. We need to present the data in a way that is both meaning and visually appealing.

```{r}
```

For this dashboard, we would like to display the locations of school shootings and provide some information about school shootings.

We are also interested in providing some context to imporant visualizations.

### Step 5

Add content to the dashboard.

```{r}
library(leaflet)
```

*This would be a great opportunity to reflect on all of the details we have shown up until this point of the tutorial. For example, discuss how this dashboard—created using `flexdashboard`—displayed a gif, used the `storyboards` feature, and in contained on a separate page. If done, this can highlight how creative of a process this really is*

The Data {data-icon="fa-database"}
===================================== 

Interactive Map {data-icon="fa-globe"}
===================================== 

Column
------------------------------------- 

### Birthplace of `R` 
    
```{r}
leaflet() %>%
  addTiles() %>%
  addMarkers(lng=174.768, lat=-36.852, popup="The birthplace of R")
```

Column
------------------------------------- 

### Chart 2
    
```{r}
```
    
### Chart 3

```{r}
```

### Chart 4

```{r}
```

Quick Stats {data-icon="fa-pie-chart"}
===================================== 
    
### Chart 1
    
```{r}
```
    
### Chart 2

```{r}
```